﻿public class NetEvent_LikeMoment : NetEvent
{
    public static NetEvent_LikeMoment NewEvent()
    {
        return new NetEvent_LikeMoment();
    }

    protected override ISerialize NewData() => new LikeMomentData();


    protected override void Excuate(ISerialize data)
    {
        LikeMomentData updateData = data as LikeMomentData;

        GameDebug.Log($"更新 LikeMomentData：{updateData?.likes?.GetListStr()} ");

        var moment = MGame.instance.MUser.moments.Find(e => e.momentId == updateData.momentId);
        if (moment != null)
            moment.likes = updateData.likes;
        else
            GameDebug.LogError($"cant find moment:{updateData.momentId }");
    }

}
